<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                template="/templates/template.xhtml">
    <ui:define name="title">广告代理渠道配置</ui:define>
    <ui:define name="content">
        <h:form>

            <div class="topbar clearfix"
                 style="background: -webkit-linear-gradient(top,#f6f7f9 0,#ebedf0 100%);">
                <p:toolbar>
                    <f:facet name="right">
                        <p:commandButton value="复制" icon="fa fa-copy"
                                         actionListener="#{collaborateAdvertiseConfigInfoBean.onCopy()}"
                                         process="@this"
                                         update="@form"
                                         rendered="#{collaborateAdvertiseConfigInfoBean.isView()}"/>
                        <p:commandButton value="保存" icon="fa fa-save" update="@form"
                                         actionListener="#{collaborateAdvertiseConfigInfoBean.save()}"/>
                        <p:commandButton value="返回列表" icon="fa fa-backward" update="@form" process="@this"
                                         action="#{collaborateAdvertiseConfigInfoBean.back()}"
                                         rendered="#{!collaborateAdvertiseConfigInfoBean.isView()}"/>
                    </f:facet>
                </p:toolbar>
            </div>

            <div class="ui-fluid" style="padding-top: 30px;">
                <div class="ui-g">
                    <div class="ui-g-12">
                        <div class="card ui-g-12">
                            <div class="ui-g">
                                <div class="ui-g-2">
                                    <p:outputLabel value="代理方账户"/>
                                </div>
                                <div class="ui-g-2">
                                    <p:inputText value="#{collaborateAdvertiseConfigInfoBean.$.account}"/>
                                </div>
                            </div>

                            <div class="ui-g-2">
                                <p:outputLabel value="渠道"/>
                            </div>
                            <div class="ui-g-2">
                                <p:selectCheckboxMenu id="channel"
                                        value="#{collaborateAdvertiseConfigInfoBean.$.channels}" label="Cities" multiple="true"
                                                      filter="true" filterMatchMode="startsWith">
                                    <f:selectItems value="#{collaborateAdvertiseConfigInfoBean.selectChannelLists}"
                                                   var="channels"
                                                   itemLabel="#{channels.channelCode}(#{collaborateAdvertiseConfigInfoBean.translate(DictionaryCode.ADS_PLATFORM_TYPE,channels.adsPlatformType)})"
                                                   itemValue="#{channels.channelCode}"/>
                                </p:selectCheckboxMenu>
                            </div>
                            <div class="ui-g-2">
                                <strong style="color: red">(注意，添加广告渠道时，所有渠道都应属同一广告平台)</strong>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </h:form>
    </ui:define>
</ui:composition>
